import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { map } from 'rxjs/operators';

import { Propertylist, PropertyRouteView } from '../interface';
import { ProjectService } from '../service/project.service';
import {CRUD_MODE} from '../../shared/config/app-settings';
@Component({
  selector: 'app-project-detail',
  templateUrl: './project-detail.component.html',
  styleUrls: ['./project-detail.component.css']
})
export class ProjectDetailComponent implements OnInit {
  CRUD_MODE = CRUD_MODE;
  mode: string;
  id: string;
  propertylist: any = {};

  constructor(
    private route: ActivatedRoute,
    private service: ProjectService,
  ) {
    // TODO
  }

  ngOnInit() {

    this.route.params.subscribe(params => {
      this.id = params['id']; // (+) converts string 'id' to a number
      console.log('id : ' + this.id);
    });


    this.route.queryParams.subscribe(params => {
      this.mode = params['mode'];
        console.log(this.mode); 

    });

  }



}
